<template>
	<view style="height: 100vh; background-color: #FFFFFF;">
		<u-navbar title-color="#FFFFFF" height="48" back-icon-color="#FFFFFF" :border-bottom="false" :is-fixed="true" title="异常反馈">
		</u-navbar>	
		<uc-content :loading="loading">
			<view style="text-align: center;">
				<u-image  width="100%" height="550rpx" :src="fireHazardsInfo.abnormalPic+'?x-oss-process=style/zip_app'" mode="aspectFit" @click="uploadPic">
					<u-loading slot="loading"></u-loading>
				</u-image>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>隐患名称:</view>
					<view>{{fireHazardsInfo.name}}</view>
				</view>
			</view>
			<view class="list-item">
				<view class="list-bottom">
					<view>生成时间:</view>
					<view>{{ fireHazardsInfo.addTime | dateFormat }}</view>
				</view>
			</view>
			<u-button v-if="fireHazardsInfo.remark==null" @click="abnormalRecord" type="primary" shape="square" style="width: 98%">隐患上报</u-button>
		</uc-content>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading: false,
				fireHazardsInfo: {
					ucId: '',
				},
				ucId:'',
			}
		},
		onLoad(e) {
			this.ucId = e.ucId
		},
		onShow() {
			this.loading = true
			this.getInHiddenDanger(this.ucId)
		},
		methods: {
			getInHiddenDanger(val) {
				this.utils.request("/api/app/inHiddenDanger/getInHiddenDanger", {
					ucId: val
				}, "post", "app", true).then(res => {
					console.log(res)
					this.loading = false
					this.fireHazardsInfo = res.data
				}).catch(error => {
					this.loading = false
					console.log(error)
				})
			},
			abnormalRecord() {
				console.log(this.fireHazardsInfo.ucId)
				uni.navigateTo({
					url: "/pages/index/abnormal/feedback?ucId=" + this.fireHazardsInfo.ucId
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/uview-ui/libs/css/style.components.scss";

	.list-item {
		padding: 20rpx 40rpx;
		background-color: #fff;
		border-bottom: #999999 1px dashed;

		.list-bottom {
			display: flex;
			margin-top: 10rpx;
			font-size: 28rpx;
			justify-content: space-between;
			color: #333;
		}

		.list-center {
			margin-top: 20rpx;
			font-size: 28rpx;
			color: #999999;
		}
	}
</style>
